package com.kehao.accountbook.pojo;


import androidx.annotation.Nullable;

import org.litepal.crud.LitePalSupport;

import java.io.Serializable;

public class Expenditure extends LitePalSupport implements Serializable {
    public static final int TYPE_FINANCIAL = 1;
    public static final int TYPE_EATTING = 2;
    public static final int TYPE_NORMAL = 3;
    public static final int TYPE_SHOPPING = 4;
    public static final int STATUS_ADD = 0;
    public static final int STATUS_REMOVE = -1;
    public static final int STATUS_LOCAL_CHANGE = 1;
    public static final int STATUS_SYNC = 9;
    private static SimpleDate date = new SimpleDate();
    private static SimpleTime time = new SimpleTime();

    private String username;
    //date
    private int year;
    private int month;
    private int day;
    //time
    private int hour;
    private int min;
    private int second;

    private int type;
    private double money;
    private String comment;

    private int status;
    private int anchor;

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Expenditure(SimpleDate date, SimpleTime time, int type, double money) {
        setDate(date);
        setTime(time);
        this.type = type;
        this.money = money;
    }

    public Expenditure(String username, SimpleDate date, SimpleTime time, int type, double money, String comment) {
        this.username = username;
        setDate(date);
        setTime(time);
        this.type = type;
        this.money = money;
        this.comment = comment;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }


    public Expenditure() {
    }


    public SimpleDate getDate() {
        date.setDay(day);
        date.setMonth(month);
        date.setYear(year);
        return date;
    }

    public void setDate(SimpleDate date) {
        year = date.getYear();
        month = date.getMonth();
        day = date.getDay();
    }

    public SimpleTime getTime() {
        time.setHour(hour);
        time.setMin(min);
        time.setSecond(second);
        return time;
    }

    public void setTime(SimpleTime time) {
        hour = time.getHour();
        min = time.getMin();
        second = time.getSecond();
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public int getMin() {
        return min;
    }

    public void setMin(int min) {
        this.min = min;
    }

    public int getSecond() {
        return second;
    }

    public void setSecond(int second) {
        this.second = second;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getAnchor() {
        return anchor;
    }

    public void setAnchor(int anchor) {
        this.anchor = anchor;
    }

    @Override
    public String toString() {
        return "Expenditure{" +
                "username='" + username + '\'' +
                ", year=" + year +
                ", month=" + month +
                ", day=" + day +
                ", hour=" + hour +
                ", min=" + min +
                ", second=" + second +
                ", type=" + type +
                ", money=" + money +
                ", comment='" + comment + '\'' +
                ", status=" + status +
                ", anchor=" + anchor +
                '}';
    }
}
